﻿
namespace QHW.Comp.AppEnum
{
    public class SaasEnum
    {
        #region Crm
        /// <summary>
        /// 获取Crm角色Id
        /// </summary>
        /// <param name="group">所在组</param>
        /// <returns>角色标识</returns>
        public static int GetCrmRole(CommonEnum.MemberVersion group)
        {
            int role;
            switch (group)
            {
                case CommonEnum.MemberVersion.Common:// Enumerate.MemberGroup.Junior:
                    role = 2;
                    break;
                case CommonEnum.MemberVersion.Advanced://Enumerate.MemberGroup.Ordinary:
                case CommonEnum.MemberVersion.Gold://Enumerate.MemberGroup.Advance:
                case CommonEnum.MemberVersion.Diamond://Enumerate.MemberGroup.Advance:
                    role = 1;
                    break;
                default:
                    role = 0;
                    break;
            }
            return role;
        }

        /// <summary>
        /// 获取Crm角色个数
        /// </summary>
        /// <param name="group">所在组</param>
        /// <returns></returns>
        public static int GetCrmRoleCount(CommonEnum.MemberVersion group)
        {
            int count;
            switch (group)
            {
                case CommonEnum.MemberVersion.Common:
                    count = 5;
                    break;
                case CommonEnum.MemberVersion.Advanced:
                    count = 10;
                    break;
                case CommonEnum.MemberVersion.Gold:
                case CommonEnum.MemberVersion.Diamond:
                    count = 50;
                    break;
                default:
                    count = 0;
                    break;
            }
            return count;
        }
        #endregion

        #region OA
        /// <summary>
        /// 获取OA角色Id
        /// </summary>
        /// <param name="group">所在组</param>
        /// <returns>角色标识</returns>
        public static int GetOaRole(CommonEnum.MemberVersion group)
        {
            int role;
            switch (group)
            {
                case CommonEnum.MemberVersion.Common:
                    role = 2;
                    break;
                case CommonEnum.MemberVersion.Advanced:
                    role = 1;
                    break;
                case CommonEnum.MemberVersion.Gold:
                case CommonEnum.MemberVersion.Diamond:
                    role = 1;
                    break;
                default:
                    role = 0;
                    break;
            }
            return role;
        }

        /// <summary>
        /// 获取OA角色个数
        /// </summary>
        /// <param name="group">所在组</param>
        /// <returns></returns>
        public static int GetOaRoleCount(CommonEnum.MemberVersion group)
        {
            int count;
            switch (group)
            {
                case CommonEnum.MemberVersion.Common:
                    count = 5;
                    break;
                case CommonEnum.MemberVersion.Advanced:
                    count = 10;
                    break;
                case CommonEnum.MemberVersion.Gold:
                case CommonEnum.MemberVersion.Diamond:
                    count = 50;
                    break;
                default:
                    count = 0;
                    break;
            }
            return count;
        }
        #endregion
    }
}
